<style type="text/css">
    .address-class select {
        width:auto;
    }
</style>
<form class="layui-form seller-alone-form" id="all_ship_form">
    <div class="layui-form-item">
        <label class="layui-form-label">订单号</label>
        <div class="layui-input-inline" style="width:620px;word-wrap:break-word;word-break:break-all;overflow:hidden;">
            <div class="layui-form-mid">{$order.order_id}</div>
        </div>
        <input type="hidden" name="order_id" value="{$order.order_id}">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">配送方式</label>
        <div class="layui-input-inline seller-inline-2">
            <div class="layui-form-mid">{$ship_name}</div>
        </div>

        <label class="layui-form-label">配送费</label>
        <div class="layui-input-inline seller-inline-2">
            <div class="layui-form-mid">{$order.cost_freight}</div>
        </div>
        <label class="layui-form-label">商品总重量：</label>
        <div class="layui-input-inline seller-inline-2">
            <div class="layui-form-mid">{$order.weight}</div>
        </div>
    </div>

    {if $order.store_id == 0}
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">收货人姓名</label>
            <div class="layui-input-inline seller-inline-2">
                <input type="text" name="ship_name" value="{$order.ship_name}"  placeholder="收货人" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">收货人电话</label>
            <div class="layui-input-inline seller-inline-2">
                <input type="text" name="ship_mobile" value="{$order.ship_mobile}"  placeholder="电话" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">收货地址</label>
        <div class="layui-input-block address-class">
            {zbshop:area name='ship_area_id' class="select-address" lay-verify="required" value="$order.ship_area_id" }
            <input type="text" name="ship_address" value="{$order.ship_address}"  placeholder="详细地址" autocomplete="off" class="layui-input" style="width:200px;display:inline;">
        </div>
    </div>
    {else /}
    <div class="layui-form-item">
        <label class="layui-form-label">收货门店</label>
        <div class="layui-input-block">
            <select name="store_id">
                {foreach $stores as $vo}
                <option value="{$vo.id}" {if $store_id == $vo['id']}selected=""{/if}>{$vo.store_name} {$vo.mobile}  {$vo.area_id|get_area} {$vo.address}</option>
                {/foreach}

            </select>
        </div>
    </div>
    {/if}

    <div class="layui-form-item">
        <label class="layui-form-label">买家备注</label>
        <div class="layui-input-inline seller-inline-6">
            <div class="layui-form-mid">
                {foreach $order.memo as $order_id=>$memo}
                    {$order_id}:{$memo}
                {/foreach}
            </div>
        </div>
    </div>
    <div class="layui-form-item" style="margin-bottom:10px;">
        <table class="layui-table" lay-size="sm">
            <colgroup>
                <col>
                <col>
                <col>
                <col width="70">
                <col width="70">
                <col width="70">
                <col width="70">
            </colgroup>
            <thead>
            <tr>
                <th>商品名称</th>
                <th>商品编码</th>
                <th>货品编码</th>
                <th>购买数量</th>
                <th>售后数量</th>
                <th>已发数量</th>
                <th>发货数量</th>
            </tr>
            </thead>
            {foreach $order.items as $key=>$vo}
            <tbody>
            <td>{$vo.name} - {$vo.addon}</td>
            <td>{$vo.bn}</td>
            <td>{$vo.sn}</td>
            <td>{$vo.nums}</td>
            <td>{if $vo.reship_nums}{$vo.reship_nums}{else /}0{/if}</td>
            <td>{if $vo.sendnums}{$vo.sendnums}{else /}0{/if}</td>
            <td><input type="number" data-id="{$vo.product_id}" name="items[{$vo.product_id}]" class="layui-input order-ship-nums no-margin-bottom" max="{$vo.nums-$vo.sendnums-$vo.reship_nums}" value="{$vo.nums-$vo.sendnums-$vo.reship_nums}" min="0"></td>
            </tbody>
            {/foreach}
        </table>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">物流公司</label>
            <div class="layui-input-inline seller-inline-4">
                <select name="logi_code" id="logi_code" lay-search>
                    <option value="">搜索选择物流公司</option>
                    {foreach $logi as $k=>$v}
                    <option value="{$v['logi_code']}" {if $v['logi_code'] == $logi_code}selected{/if}>{$v['logi_name']}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">物流单号</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="logi_no" value="" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">发货备注</label>
        <div class="layui-input-block">
            <input type="text" name="memo" value="" class="layui-input">
        </div>
    </div>
</form>
<script>
    //渲染表单
    layui.use('form', function() {
        var form = layui.form;
        form.render();
    });
</script>